package thread.createthread;

/**
 * @author cyt
 * @create 2020-03-03 15:45
 */
public class NewThread extends Thread {
    @Override
    public void run() {
        for (int i = 0; i <= 10; i++) {
            System.out.println("当前的线程为：" + Thread.currentThread().getName() + " -->" + i);
            try {
                Thread.sleep(500);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        NewThread new_thread = new NewThread();
        new_thread.start();
        System.out.println("主线程为：" + Thread.currentThread().getName());
    }
}
